﻿using HMagicShell.ModeView;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“内容对话框”项模板

namespace HMagicShell
{
    public sealed partial class WebShellConfigDialog : ContentDialog
    {
        private WebShellConfigModeView m_pModeView = new WebShellConfigModeView();

        public WebShellConfigDialog()
        {
            this.InitializeComponent();
            MainGrid.DataContext = m_pModeView;
        }

        public void SetWebShellConfig(CWebShellInfo info)
        {
            m_pModeView.SetInfo(info);
        }

        public CWebShellInfo GetWebShellConfig()
        {
            return new CWebShellInfo(m_pModeView.Url, m_pModeView.Password, m_pModeView.Remark, m_pModeView.Guid, m_pModeView.Type, m_pModeView.Encoding);
        }

        private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {

        }
    }
}
